/*************************************************************************
	> File Name: ChainOfResponsibility.h
	> Author: Joker
	> Mail: mahongtao@foxmail.com 
	> Created Time: 2020-09-22 12:32:27
 ************************************************************************/

#ifndef __CHAINOFRESPONSIBILITY_H__
#define __CHAINOFRESPONSIBILITY_H__

class Handler
{
public:
    Handler(Handler * pSuccessor = nullptr);
    virtual ~Handler();

    virtual void HandleRequest() = 0;
protected:
    Handler * _pSuccessor;
};

class ConcreateHandler1
:public Handler
{
public:
    ConcreateHandler1(Handler * pSuccessor = nullptr)
        :Handler(pSuccessor){}
    virtual ~ConcreateHandler1(){}

    virtual void HandleRequest();
};

class ConcreateHandler2
:public Handler
{
public:
    ConcreateHandler2(Handler * pSuccessor = nullptr)
        :Handler(pSuccessor){}
    virtual ~ConcreateHandler2(){}

    virtual void HandleRequest();
};

#endif
